package com.lighthouse.repo.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 目录信息对象 lh_repo_base_info
 * 
 * @author ysz
 * @date 2023-05-05
 */
public class KnowledgeRepoBaseInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private String repoId;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String repoName;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String parentId;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Integer idDelete;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long deleteBy;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Date deleteTime;

    /** 排序字段 */
    @Excel(name = "排序字段")
    private Long sortNo;

    /** 子目录数量 */
    @Excel(name = "子目录数量")
    private Long childRepoNum;

    /** 文档数量 */
    @Excel(name = "文档数量")
    private Long docNum;

    /** 内部文档的最后修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "内部文档的最后修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date repoUpdateTime;

    /** 根ID */
    @Excel(name = "根ID")
    private String rootId;

    /** 子目录 */
    private List<KnowledgeRepoBaseInfo> children = new ArrayList<KnowledgeRepoBaseInfo>();

    public void setRepoId(String repoId) 
    {
        this.repoId = repoId;
    }

    public String getRepoId() 
    {
        return repoId;
    }
    public void setRepoName(String repoName) 
    {
        this.repoName = repoName;
    }

    public String getRepoName() 
    {
        return repoName;
    }
    public void setParentId(String parentId) 
    {
        this.parentId = parentId;
    }

    public String getParentId() 
    {
        return parentId;
    }
    public void setIdDelete(Integer idDelete) 
    {
        this.idDelete = idDelete;
    }

    public Integer getIdDelete() 
    {
        return idDelete;
    }
    public void setDeleteBy(Long deleteBy) 
    {
        this.deleteBy = deleteBy;
    }

    public Long getDeleteBy() 
    {
        return deleteBy;
    }
    public void setDeleteTime(Date deleteTime) 
    {
        this.deleteTime = deleteTime;
    }

    public Date getDeleteTime() 
    {
        return deleteTime;
    }
    public void setSortNo(Long sortNo) 
    {
        this.sortNo = sortNo;
    }

    public Long getSortNo() 
    {
        return sortNo;
    }
    public void setChildRepoNum(Long childRepoNum) 
    {
        this.childRepoNum = childRepoNum;
    }

    public Long getChildRepoNum() 
    {
        return childRepoNum;
    }
    public void setDocNum(Long docNum) 
    {
        this.docNum = docNum;
    }

    public Long getDocNum() 
    {
        return docNum;
    }
    public void setRepoUpdateTime(Date repoUpdateTime) 
    {
        this.repoUpdateTime = repoUpdateTime;
    }

    public Date getRepoUpdateTime() 
    {
        return repoUpdateTime;
    }
    public void setRootId(String rootId) 
    {
        this.rootId = rootId;
    }

    public String getRootId() 
    {
        return rootId;
    }

    public List<KnowledgeRepoBaseInfo> getChildren() {
        return children;
    }

    public void setChildren(List<KnowledgeRepoBaseInfo> children) {
        this.children = children;
    }

    public void setCreateInfo() {
        this.repoId = UUID.fastUUID().toString();
        this.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName());
        this.setCreateTime(new Date());
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("repoId", getRepoId())
            .append("repoName", getRepoName())
            .append("parentId", getParentId())
            .append("idDelete", getIdDelete())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("deleteBy", getDeleteBy())
            .append("deleteTime", getDeleteTime())
            .append("sortNo", getSortNo())
            .append("childRepoNum", getChildRepoNum())
            .append("docNum", getDocNum())
            .append("repoUpdateTime", getRepoUpdateTime())
            .append("rootId", getRootId())
            .toString();
    }
}
